@extends('backend::common.common_right')
@section('content')
<style>
    #file {position: absolute;left: 0;width: 100%;height: 100%;top: 0;opacity: 0;z-index: 2;cursor: pointer;}
    #show_img{border:1px solid #eee;width:100%;height: 100%;}
</style>
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>添加/编辑站内广播消息</h5>
                    <div class="ibox-tools">
                        <a type="button" class="close" href="{{url('backend/banner',['type'=>$type])}}"> <span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <form class="form-horizontal m-t"  action="{{url('backend/banneredit')}}" method="post" id="signupForm">
                        {{ csrf_field() }}
                        <input type="hidden" name="id" value="{{$banner->id or ''}}">
                        <input type="hidden" name="type" value="{{$type}}">
                        <input type="hidden" name="sort" value="0">
                        <input type="hidden" name="url" value="http://www.jishe.com">
                        <div class="form-group{{ $errors->has('title') ? ' has-error' : '' }}">
                            <label class="col-sm-3 control-label">通知内容：</label>
                            <div class="col-sm-8">
                            <input type="text" value="{{ $banner->title or '' }}" name="title" class="form-control" placeholder="通知内容" id="title">
                            @if ($errors->has('title'))
                                <span class="help-block">
                                        <strong>{{ $errors->first('title') }}</strong>
                                    </span>
                            @endif
                            </div>
                        </div>
                        <div class="form-group">
                        <label class="col-sm-3 control-label">是否展示：</label>
                            <div class="col-sm-8">
                                <label class="radio-inline">
                                    <input type="radio" checked="" value="1" id="optionsRadios1" name="is_show">展示</label>
                                <label class="radio-inline">
                                    <input type="radio" @isset($banner->is_show) @if($banner->is_show == '隐藏')checked @endif @endisset value="0" id="optionsRadios2" name="is_show">隐藏</label>
                            </div>
                        </div>
                        <div class="form-group{{ $errors->has('url') ? ' has-error' : '' }}">
                            <label class="col-sm-3 control-label">链接地址：</label>
                            <div class="col-sm-8">
                                <input type="text" name="url" class="form-control" value='{{$banner->url or ''}}' placeholder="请输入跳转链接">
                                @if ($errors->has('url'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('url') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-8 col-sm-offset-3">
                                <button class="btn btn-primary" type="submit">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
someCallback = function(){
// Example
    var path = '/storage/'+this.savedPath;
    $("#show_img").attr('src',path);
}
</script>
@endsection